package cn.outsourcing.supermarket.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: supermarket
 * @Description: 订单状态枚举
 * @Author: JPDark
 * @CreateTime: 2021-10-23 21:43
 **/
@Getter
@AllArgsConstructor
public enum OrderStatusEnums {
    /**
     * 101：未付款、102：已取消、103已取消(系统)、201：已付款、202：订单取消，退款中、203：已退款、301：已发货、302：已收货、303：已收货(系统)、401：已完成、801：拼团中,未付款、802：拼团中,已付款
     */
    UNPAID(101, "未付款"),
    CANCELLED(102, "交易关闭"),
    CANCELLED_SYSTEM(103, "交易关闭"),
    PAID(201, "待备货"),
    CANCEL_RETURN_IN_PROGRESS(202, "退款中"),
    REFUNDED(203, "已退款"),
    SHIPPED(301, "已备货"),
    RECEIVED_GOODS(302, "待评价"),
    RECEIVED_GOODS_SYSTEM(303, "待评价"),
    COMPLETED(401, "交易成功"),
    IN_PUZZLE_UNPAID(801, "拼团中,未付款"),
    IN_PUZZLE_PAID(802, "拼团中,已付款");
    /** 订单状态标识数值 */
    Integer code;
    /** 订单状态标识中文 */
    String text;

    public static final Map<Integer,String> DATA_MAP = new HashMap<Integer,String>()
    {
        {
            put(UNPAID.code, UNPAID.text);
            put(CANCELLED.code, CANCELLED.text);
            put(CANCELLED_SYSTEM.code, CANCELLED_SYSTEM.text);
            put(PAID.code, PAID.text);
            put(CANCEL_RETURN_IN_PROGRESS.code, CANCEL_RETURN_IN_PROGRESS.text);
            put(REFUNDED.code, REFUNDED.text);
            put(SHIPPED.code, SHIPPED.text);
            put(RECEIVED_GOODS.code, RECEIVED_GOODS.text);
            put(RECEIVED_GOODS_SYSTEM.code, RECEIVED_GOODS_SYSTEM.text);
            put(COMPLETED.code, COMPLETED.text);
            put(IN_PUZZLE_UNPAID.code, IN_PUZZLE_UNPAID.text);
            put(IN_PUZZLE_PAID.code, IN_PUZZLE_PAID.text);
        }
    };
}
